package cn.edu.ctbu.finaltest.service.AdministratorTeacherTeachingService.impl;


import cn.edu.ctbu.finaltest.exception.REnum;
import cn.edu.ctbu.finaltest.service.AdministratorTeacherTeachingService.AdministratorTeacherTeachingService;
import cn.edu.ctbu.finaltest.vo.AdministratorTeacherTeaching;
import cn.edu.ctbu.finaltest.vo.R;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class AdministratorTeacherTeachingImplService implements AdministratorTeacherTeachingService {

//        private Integer id;
//        private String tno;
//        private String tname;
//        private String sex;
//        private String dept;
//        private String cno;
//        private String cname;


    public R<List<AdministratorTeacherTeaching>> findByRCno(String cno, List<AdministratorTeacherTeaching> ATTList){
        List<AdministratorTeacherTeaching> administratorSelectCourses = new ArrayList<>();
        for (int i = 0;i < ATTList.size();i++){
            if (cno.equals(ATTList.get(i).getCno())){
                administratorSelectCourses.add(ATTList.get(i));
            }
        }
        R<List<AdministratorTeacherTeaching>> RAll = new R<>();
        RAll.setData(administratorSelectCourses);
        RAll.setMsg(REnum.SUCCESS.getMsg());
        RAll.setCode(REnum.SUCCESS.getCode());
        return RAll;
    }


    public R<List<AdministratorTeacherTeaching>> findByRSex(String sex,List<AdministratorTeacherTeaching> ATTList){
        List<AdministratorTeacherTeaching> administratorSelectCourses = new ArrayList<>();
        for (int i = 0;i < ATTList.size();i++){
            if (sex.equals(ATTList.get(i).getSex())){
                administratorSelectCourses.add(ATTList.get(i));
            }
        }
        R<List<AdministratorTeacherTeaching>> RAll = new R<>();
        RAll.setData(administratorSelectCourses);
        RAll.setMsg(REnum.SUCCESS.getMsg());
        RAll.setCode(REnum.SUCCESS.getCode());
        return RAll;
    }



}


